import { Get, Inject, Provide, Query } from '@midwayjs/decorator';
import { CoolController, BaseController } from '@cool-midway/core';
import { DoupiaopiaoUserService } from '../../service/user';
/**
 * 用户
 */
@Provide()
@CoolController()
export class BusinessAppUserController extends BaseController {
  @Inject()
  doupiaopiaoUserService: DoupiaopiaoUserService;
  /**
   * 获取当前登录用户信息
   */
  @Get('/userinfo', { summary: '获取当前登录用户信息' })
  async userinfo() {
    const result = await this.doupiaopiaoUserService.getUserinfoByClient();
    return this.ok(result);
  }

  //更新当前用户的某些信息
  @Get('/updatedUserInfo', { summary: '更新当前用户信息' })
  async updatedUser(@Query() query) {
    const result = await this.doupiaopiaoUserService.updatedInfo(query);
    return this.ok(result);
  }
}
